package cn.iocoder.yudao.module.digital.service.cardkeyqueuein;

import cn.iocoder.yudao.module.digital.dal.dataobject.cardkeyqueuein.CardkeyQueueInDO;
import cn.iocoder.yudao.module.digital.enums.cardkeyqueue.CardkeyInQueueStatusEnum;
import cn.iocoder.yudao.module.digital.enums.cardkeysecret.CardKeySourceEnum;

import java.util.Collection;
import java.util.List;

/**
 * 卡密in队列 Service 接口
 *
 * @author 超管
 */
public interface CardkeyQueueInService {


    /**
     * 获得卡密in队列
     *
     * @param id 编号
     * @return 卡密in队列
     */
    CardkeyQueueInDO getCardKeyQueueIn(String id);

    long countQueue(Collection<CardkeyInQueueStatusEnum> inStatusList, String productNo, Integer buyDenomination);

    void createCardKeyInQueue(String orderNo, Long userId, CardKeySourceEnum source, String productNo,
                              String currencyCode, Integer buyDenomination, Integer replenishingStock);

    List<CardkeyQueueInDO> getCardKeyInQueueByStatus(Collection<CardkeyInQueueStatusEnum> inStatusList);

    List<CardkeyQueueInDO> getCardKeyInQueueByStatus(CardKeySourceEnum sourceStatus, Collection<CardkeyInQueueStatusEnum> inStatusList);

    void updateCardKeyInQueueStatus(String id, CardkeyInQueueStatusEnum status, String errorMsg);

    void updateCardKeyInQueueStatus(String id, CardkeyInQueueStatusEnum sourceStatus, CardkeyInQueueStatusEnum targetStatus, String errorMsg);

    int assignCardOrderId(CardKeySourceEnum source);
}